package name.sraynal.msgdispatcher.view;

import java.util.Iterator;
import java.util.Set;

import name.sraynal.msgdispatcher.controller.Controller;
import name.sraynal.msgdispatcher.event.Event;

public abstract class View {
	
	protected Set<Controller> controllers;
	
	public View(Set<Controller> controllers) {
		this.controllers = controllers;
	}
	
	protected final void sendEvent(Event event) {
		Iterator<Controller>  it = this.controllers.iterator();
		
		while (it.hasNext()) {
			it.next().sendEvent(event);
		}
	}
}
